x86/HVM: reduce scope of pfec in hvm_emulate_init_per_insn()
authorJan Beulich <jbeulich@suse.com>
Thu, 6 Feb 2020 15:23:30 +0000 (16:23 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 6 Feb 2020 15:23:30 +0000 (16:23 +0100)
commit72dbcf0c065037dddb591a072c4f8f16fe888ea8
tree123d8665a3df7c6c825d5223bea5c29cc2bdf86a
parent38d106d7b09a6c024b7b443ee79ff1e1db5105c4
x86/HVM: reduce scope of pfec in hvm_emulate_init_per_insn()

It needs calculating only in one out of three cases. Re-structure the
code a little such that the variable truly gets calculated only when we
don't get any insn bytes from elsewhere, and hence need to (try to)
fetch them. Also OR in PFEC_insn_fetch right in the initializer.

While in this mood, restrict addr's scope as well.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Paul Durrant <pdurrant@amazon.com>
xen/arch/x86/hvm/emulate.c